'use strict';


const axios = require('axios');


// var proxy = {
//     host: "127.0.0.1", 
//     port: 8888,
//     auth: { 
//         username: '',password: ''
//     }
// };

// axios.defaults.proxy=proxy;

axios.interceptors.request.use(config => {
    console.log(config.method,config.url)
    return config;
},error=>{
     Promise.reject(error)
   }
);




exports.main = async (event, context) => {
	
	  console.log(JSON.stringify(event))
      console.log("---------------------------------------")
	  
	   let params=JSON.parse(event.body)
	    console.log(params.app)
	   console.log("---------------------------------------")
      console.log(JSON.stringify(context))
 
  //event为客户端上传的参数
   let r=await axios.get("https://minglie.gitee.io/mingpage/static/mingpage.json")   
  console.log(r.data)
  //返回数据给客户端
  return r.data
};
